package com.example.yuejian.yuejian.bean;

import com.google.gson.Gson;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2017/9/27.
 */

public class UsersInfo {


    /**
     * id : 1
     * password : 123456
     * nickname : 朔朔
     * turename : 12
     * phone : 18910789114
     * gender : 0
     * photo : http://10.0.2.2/laravel54/public/Uploads/2017-09-05-14-23-16-59aeb35490b40.jpg
     * address : 大连
     */

    private int id;
    private String password;
    private String nickname;
    private String turename;
    private String phone;
    private int gender;
    private String photo;
    private String address;

    public static UsersInfo objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), UsersInfo.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public void setTurename(String turename) {
        this.turename = turename;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getId() {
        return id;
    }

    public String getPassword() {
        return password;
    }

    public String getNickname() {
        return nickname;
    }

    public String getTurename() {
        return turename;
    }

    public String getPhone() {
        return phone;
    }

    public int getGender() {
        return gender;
    }

    public String getPhoto() {
        return photo;
    }

    public String getAddress() {
        return address;
    }
}
